Skip to main content

use latex here

factorial(input: number[] | number[][] | Mat | Tensor | number) : Number | any[] | Mat | Tensor

param input The structure to find the factorial of [element-wise]. Can be a number, Mat, javascript array or Tensor

returns: any[] | Mat | Tensor | number - In the case of a number it returns input!. In the case of a matrix-like structure, it returns a copy of the matrix with each element replaced by its factorial, i.e. element-wise factorial. Recall that a factorial of a number is number!=number*number-1*number-2*...*2*1

use latex